function onPageReady() {
    $(".title span").html("看&nbsp;时&nbsp;势");
    ajax({
        url: "/api/home/getEventInfo/" + $.paramToObj().id,
        type: "get",
        dataType: "json",
        headers: {},
        success: function (result) {
            thumb = result.data.coverImgs[0];
            if (result.data.favoured) {
                $(".collection").addClass("selected");
            }
            $(".main>div").render("#detail", result.data, "html");
            $(".collection").on("click", function (event) {
                event.preventDefault();
                var $this = $(this);
                ajax({
                    url: "/api/home/markFavorite",
                    type: "post",
                    dataType: "json",
                    headers: {
                        "content-type": "application/json"
                    },
                    data: JSON.stringify({
                        appUserId: getLocalItem("user") ? new AppUserBean(getLocalItem("user")).id : '',
                        status: $this.hasClass("selected") ? 0 : 1,
                        subjectId: $.paramToObj().id,
                        type: "1"
                    }),
                    success: function (result) {
                        $this.toggleClass("selected");
                    }
                });
                return false;
            });
            $('.share').on('click', function () {
                $('.shareBar').css('display', 'flex');
            });
            var font = 0;
            $('.font').on('click', function () {
                font = (font + 1) % 3;
                $('.content').removeClass('large').removeClass('larger').addClass(['', 'large', 'larger'][font]);
            });
            initPreview('img');
        }
    });
    var weixin = null, qq = null;
    try {
        plus.share.getServices(function (services) {
            for (var i in services) {
                switch (services[i].id) {
                    case 'weixin': {
                        weixin = services[i];
                        break;
                    }
                    case 'qq' : {
                        qq = services[i];
                        break;
                    }
                }
            }
        }, function (e) {
            console.log("获取分享服务列表失败：" + e.message);
        });
    } catch (e) {
    }
    $('.shareBar-bg').on('click', function () {
        $('.shareBar').hide();
    });
    $('.share').on('click', function () {
        $('.shareBar').css('display', 'flex');
    });
    window.jumpShare = function (i) {
        var service = null, extra = {};
        switch (i) {
            case 1: {
                service = weixin;
                extra = {scene: "WXSceneTimeline"};
                break;
            }
            case 2: {
                service = qq;
                break;
            }
            default: {
                service = weixin;
                extra = {scene: "WXSceneSession"}
            }
        }
        ajax({
            url: "/api/home/getEventDetail/" + $.paramToObj().id,
            type: "get",
            dataType: "json",
            headers: {},
            success: function (result) {
                share(service, $('.main .title').html(), result.data,thumb, extra);
            }
        });
    }
}